package com.thh.shirodemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.thh.shirodemo.bean.Goods;
import com.thh.shirodemo.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author AdrianHHT
 * @create 2022-07-28-15:16
 */
@Mapper
public interface GoodsMapper  extends BaseMapper<Goods> {
    //查找参与秒杀的商品名称 只能有一种商品正在参与秒杀
    @Select("select goods_name from goods where is_seckill=1")
    public String getSecKillGood();

    //通过商品名获取该商品
    @Select("select * from goods where goods_name=#{goodsName}")
    public Goods getGoodsByName(String goodsName);
}
